home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / debugger / ddd-1.000 / ddd-1 / ddd-1.4b / etc / nh < prev    next >
Encoding:
Text File  |  1996-01-11  |  1.9 KB  |  73 lines

  1. #! /bin/sh
  2. # $Id: nh,v 1.3 1996/01/11 16:35:59 zeller Exp $
  3. # make new header file
  4.  
  5. # Copyright (C) 1993 Technische Universitaet Braunschweig, Germany.
  6. # Written by Andreas Zeller (zeller@ips.cs.tu-bs.de).
  7. # This file is part of NORA.
  8. # NORA is free software; you can redistribute it and/or
  9. # modify it under the terms of the GNU General Public
  10. # License as published by the Free Software Foundation; either
  11. # version 2 of the License, or (at your option) any later version.
  12. # NORA is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. # See the GNU General Public License for more details.
  16. # You should have received a copy of the GNU General Public
  17. # License along with NORA -- see the file COPYING.
  18. # If not, write to the Free Software Foundation, Inc.,
  19. # 675 Mass Ave, Cambridge, MA 02139, USA.
  20. # NORA is an experimental inference-based software development
  21. # environment. Contact nora@ips.cs.tu-bs.de for details.
  22.  
  23. this=`basename $0`
  24. path=`dirname $0`
  25. user=""
  26.  
  27. case `pwd` in
  28.     *ddd*)    prefix=_DDD;;
  29.     */ice/*)  prefix=_ICE;;
  30.     */ice)    prefix=_ICE;;
  31.     */nora/*) prefix=_Nora;;
  32.     */nora)   prefix=_Nora;;
  33.     *)        prefix=;;
  34. esac
  35.  
  36. if [ "$1" = "-l" ]; then
  37.   user="-l $2"
  38.   shift 2
  39. fi
  40.  
  41. for name in $*
  42. do
  43.     name=`basename $name .h`
  44.     file=`echo $name | $path/shorten 10`
  45.     if [ -f $file.h ]; then
  46.     echo "$file.h already exists"
  47.     else
  48.     (
  49.        echo '// $Id''$ -*- C++ -*-'
  50.        echo '//'
  51.        echo
  52.        echo '#ifndef '$prefix'_'$name'_h'
  53.        echo '#define '$prefix'_'$name'_h'
  54.        echo 
  55.        echo '#ifdef __GNUG__'
  56.        echo '#pragma interface'
  57.        echo '#endif'
  58.        echo
  59.        echo
  60.        echo '#endif // '$prefix'_'$name'_h'
  61.        echo "// DON'T ADD ANYTHING BEHIND THIS #endif"
  62.     ) > $file.h
  63.     $path/apply-license $user $file.h > /dev/null
  64.     rm $file.h~
  65.      ${VISUAL:-vi} $file.h
  66.     fi
  67. done
  68.